package phenix.com.phenixdemo.mvp.presenter;

import phenix.com.phenixdemo.mvp.model.IUser;
import phenix.com.phenixdemo.mvp.model.User;
import phenix.com.phenixdemo.mvp.view.ILogin;

/**
 * Created by zhouphenix on 2016-3-20.
 */
public class LoginPresenterImp implements ILoginPresenter,IUser {
    User user;
    ILogin iLogin;

    public LoginPresenterImp(ILogin iLogin) {
        this.iLogin = iLogin;
        user = loadOne();
    }

    @Override
    public boolean attemptLogin() {

        return false;
    }

    @Override
    public boolean isAccountValid(String account) {
        return account.contains("@");
    }

    @Override
    public boolean isPasswordValid(String password) {
        return password.length() > 4;
    }

    @Override
    public User loadOne() {
        return new User("zhou@qq.com","123456");
    }
}
